<?xml version="1.0" encoding="windows-1252"?>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:composite="http://java.sun.com/jsf/composite"
      xmlns:ui="http://java.sun.com/jsf/facelets">

    <!-- INTERFACE -->
    <composite:interface>
        <composite:attribute name="managedBean"/>
    </composite:interface>

    <!-- IMPLEMENTATION, the cc's below are predefined-->
    <composite:implementation>
        <h:form>
            #{cc.attrs.managedBean.loadTravelagents()}

            <h1>Administrera agenter</h1>
            <table class="manageTable">
                <thead>
                    <tr>
                        <td class="username">Anvandarnamn</td>
                        <td class="password">Losenord</td>
                        <td class="firstName">Fornamn</td>
                        <td class="lastName">Efternamn</td>
                        <td class="email">Emejl</td>
                        <td class="email">Radera</td>
                    </tr>

                </thead>
                <tbody>
                <ui:repeat var="travelagent" value="#{cc.attrs.managedBean.travelagents}">
                    <tr>
                        <td>#{travelagent.getAccount1().getUsername()}</td>
                        <td>#{travelagent.getAccount1().getPassword()}</td>
                        <td>#{travelagent.getAccount1().getFirstname()}</td>
                        <td>#{travelagent.getAccount1().getLastname()}</td>
                        <td>#{travelagent.getAccount1().getEmail()}</td>
                        <td><h:commandLink value="Radera" action="#{cc.attrs.managedBean.deleteTravelagent}">
                        <f:setPropertyActionListener target="#{cc.attrs.managedBean.selectedTravelagentUsername}" value="#{travelagent.getAccount1().getUsername()}" />
                    </h:commandLink>
                    </td>
                    </tr>
                </ui:repeat>
                </tbody>
            </table>
        </h:form>
        <div class="error">
            <h:messages layout="table"/>
        </div>
    </composite:implementation>
</html>